import { memo } from 'react';
import { Tooltip as AntdTooltip } from 'antd';
import type { Props } from './interface';

/**
 * 文字提示
 */
function Tooltip(props: Props) {
  const { children, color = '#ccc', title, trigger } = props;

  return (
    <AntdTooltip
      color="#252525"
      arrow={false}
      title={title}
      trigger={trigger}
      overlayInnerStyle={{ color, border: '1px solid #454545', fontSize: '13px', lineHeight: '130%' }}
    >
      {children}
    </AntdTooltip>
  );
}

/**
 * 文字提示
 */
export default memo(Tooltip);
